package com.trkj.service.lzs;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.trkj.dao.lzs.SocialLeixingDao;
import com.trkj.pojo.ProjectTemplate;
import com.trkj.pojo.Recruitapply;
import com.trkj.pojo.Salary;
import com.trkj.pojo.SalaryAccount;
import com.trkj.pojo.SocialLeixing;
import com.trkj.pojo.SocialSecurity;

@Service
public class SocialLeixingService {
	@Autowired
private  SocialLeixingDao SocialLeixingdao;
//查询所有
	public  List<SocialLeixing>  SocialLeixingfall(){
	   return (List<SocialLeixing>) SocialLeixingdao.findAll();
		
	}
	//添加
	public void SocialLeixingadd(Timestamp sblxDate,String sblxName, String sblxPerson,Timestamp sblxUpdate, BigDecimal sblxZt) {
		try {
			SocialLeixing ab= new SocialLeixing();
			ab.setSblxDate(sblxDate);
			ab.setSblxName(sblxName);
			ab.setSblxUpdate(sblxUpdate);
			ab.setSblxZt(sblxZt);
			ab.setSblxPerson(sblxPerson);
			SocialLeixingdao.save(ab);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	//编辑  
    public   void lzs_SocialLeixingbj( long sblxId,  Timestamp sblxDate,String sblxName, String sblxPerson,Timestamp sblxUpdate, BigDecimal sblxZt
			) {
    	SocialLeixing edit =SocialLeixingdao.findOne(sblxId);
   	    edit.setSblxDate(sblxDate);
   	    edit.setSblxDate(sblxDate);
	   	edit.setSblxName(sblxName);
	   	edit.setSblxUpdate(sblxUpdate);
	   	edit.setSblxZt(sblxZt);
	   	edit.setSblxPerson(sblxPerson);
		   	 
	   	SocialLeixingdao.save(edit);
    }
    public SocialLeixing chun1(Long sblxId) {
   	 return SocialLeixingdao.findOne(sblxId);
		
    }
    //模糊查询
 	public  List<SocialLeixing> queryByName (String  text){

			return SocialLeixingdao.queryByName("%" + text + "%");
		}
 	  public boolean dltRay(Long sblxId) {
	 		if(SocialLeixingdao.exists(sblxId)){
	 			SocialLeixingdao.delete(sblxId);
	 			 return true;
	 		}
	 		return false;
	  }
}
